package com.ysxsoft.wdg.base;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.ZoomControls;

import com.classic.common.MultipleStatusView;
import com.ysxsoft.wdg.R;
import com.ysxsoft.wdg.util.WebViewUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * webViw基类
 */
public class BaseGWebViewActivity extends BaseActivity {
    @BindView(R.id.topView)
    View topView;
    @BindView(R.id.title_finish)
    ImageView titleFinish;
    @BindView(R.id.title_content)
    TextView titleContent;
    @BindView(R.id.title_iv_r)
    ImageView titleIvR;
    @BindView(R.id.title_tv_r)
    TextView titleTvR;
    @BindView(R.id.webView)
    WebView webView;
    @BindView(R.id.multStatusView)
    MultipleStatusView multStatusView;

    public static void start(Context context, String title, String content) {
        Intent i = new Intent(context, BaseGWebViewActivity.class);
        i.putExtra("title", title);
        i.putExtra("content", content);
        context.startActivity(i);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_base_web_view;
    }

    @Override
    protected void initData() {
        String t=getIntent().getStringExtra("title");
        String c=getIntent().getStringExtra("content");
        initStatusBar(topView, false);
        titleContent.setText(t);
        WebViewUtils.init(webView);
        WebViewUtils.setH5Data(webView,c);
    }

    @Override
    protected void setListener() {
    }

    @OnClick(R.id.title_finish)
    public void onViewClicked() {
        finish();
    }
}
